package com.github.gin.springboot.respostory;

import com.github.gin.springboot.model.Order;
import com.github.gin.springboot.model.OrderItem;
import org.springframework.data.jpa.repository.EntityGraph;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

/**
 * Created by FSTMP on 2016/12/26.
 */
public interface OrderRepostory extends JpaRepository<Order,Long> {

    @EntityGraph(value = "graph.Order.items", type = EntityGraph.EntityGraphType.LOAD)
    Order getByOrderNumber(String name);

}
